import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
import { AppConfig } from '@/config/AppConfig'
import { staticRoutes } from '@/router/modules/staticRoutes'

const routerMode = {
  history: () => createWebHistory(AppConfig.getBaseUrl()),
  hash: () => createWebHashHistory(AppConfig.getBaseUrl()),
}

const router = createRouter({
  history: routerMode[AppConfig.getRouterMode()](),
  routes: staticRoutes,
})

export default router
